package com.qfedu.common.core.utils;

/**
 * @Classname UserUtils
 * @Description TODO
 * @Date 2025-05-26 14:16
 * @Created by 老任与码
 */

/**
 * ThreadLocal 存储用户id
 */
public class UserUtils {

    private static ThreadLocal<Integer> threadLocal = new ThreadLocal<>();

    public static void setUid(Integer uid) {
        threadLocal.set(uid);
    }

    public static Integer getUid() {
        return threadLocal.get();
    }

    public static void removeUid() {
        threadLocal.remove();
    }
}
